package org.example;

import lombok.extern.slf4j.Slf4j;
import org.example.util.ConfigLoader;

import java.util.Properties;
import java.util.Set;

/**
 * @author mayingfa
 */
@Slf4j
public class Application {
    private static final String PROPERTY_FILE_NAME = "config.properties";

    private static final Properties SCRIPT_ENGINE_CONFIG = new Properties();

    public static void main(String[] args) {
        Set<String> locations = ConfigLoader.getDefaultLoadOrder(PROPERTY_FILE_NAME);
        ConfigLoader loader = new ConfigLoader(locations);
        SCRIPT_ENGINE_CONFIG.putAll(loader.loadProperties());
        log.info(SCRIPT_ENGINE_CONFIG.getProperty("name"));
        log.info(SCRIPT_ENGINE_CONFIG.getProperty("age"));
        log.info(SCRIPT_ENGINE_CONFIG.getProperty("height"));
    }
}
